#pragma once
#include <string>
#include <vector>
#include "..\dxstdafx.h"
#include "..\base\Engine.h"
#include "..\renderer\Renderer.h"
#include "VertexBuffer.h"
#include "..\utils\GameMath.h"

namespace ds {

class TexturedVertexBuffer : public VertexBuffer {

struct TexturedVertex {
    float x,y,z; 
	float nx,ny,nz;
	DWORD color;
    float tu, tv;		
};

typedef std::vector<TexturedVertex> Vertices;

public:
    TexturedVertexBuffer(D3DPRIMITIVETYPE primitiveType,uint32 maxVertices,bool dynamic = false);
    void addVertex(float x,float y,float z,float u,float v);	
	void addVertex(float x,float y,float z,float nx,float ny,float nz,float u,float v);	
    bool createBuffer();
	bool create(int size);
	void clear();
    int getSize() { return m_Vertices.size();}
    int getVertexSize() { return sizeof(TexturedVertex);}    
    virtual ~TexturedVertexBuffer();
private:
    Vertices m_Vertices;
	uint32 m_MaxVertices;
};

};


